\section{linspace --- linearly spaced vector}
\label{fn:linspace}
\index{linspace()}
\index{linearly spaced vector}
\index{vector!linearly spaced}
\begin{rail}
Linspace : 'linspace' '(' Scalar  ',' Scalar ( ',' Scalar)? ')' ;
\end{rail}

\verb+linspace+ creates a vector of linearly spaced points between the
first and second arguments. If the optional third argument is present,
it specifies how many points are to be created.  If the third argument
is missing, then 100 points are assumed.

$\Longrightarrow$ This is not an \RLaB\ built-in function.  This function
is normally loaded on start-up from the \verb+linspace.r+ file in the
standard \verb+rlib+ directory. Use of the \verb+-r+ option, incorrectly 
setting the \verb+RLAB_LIB_DIR+ environmental variable, or modifying
\verb+linspace.r+ may make this function unavailable.


\paragraph{Example}
\index{example of linspace()}
\index{linspace()!example}
\begin{verbatim}
> a = linspace(2,20);
> show(a)
   name:      a     
   class:     num   
   type:      real  
     nr:      1     
     nc:      100   
> b = linspace(3.5,9.6,10)
 b =
 matrix columns 1 thru 6
      3.5       4.18       4.86       5.53       6.21       6.89  

 matrix columns 7 thru 10
     7.57       8.24       8.92        9.6  
> A = linspace(5,-5,13)
 A =
 matrix columns 1 thru 6
        5       4.17       3.33        2.5       1.67      0.833  

 matrix columns 7 thru 12
        0     -0.833      -1.67       -2.5      -3.33      -4.17  

 matrix columns 13 thru 13
       -5  
> c = linspace(1,9,10)+(linspace(-4,4,10)*(0+1j))
 c =
 matrix columns 1 thru 3
                  1 - 4i            1.89 - 3.11i            2.78 - 2.22i

 matrix columns 4 thru 6
            3.67 - 1.33i           4.56 - 0.444i           5.44 + 0.444i

 matrix columns 7 thru 9
            6.33 + 1.33i            7.22 + 2.22i            8.11 + 3.11i

 matrix columns 10 thru 10
                  9 + 4i
\end{verbatim}

See also: Page~\pageref{fn:logspace} \verb+logspace()+.

\newpage






